## Run below code to reproduce results for appendix and manuscript. 
## Please see each individual script for additional details. 
## Note: you must run appendix_section_a.R before manuscript.R

## Use devtools to install attentive package if not already installed:
## install.packages("devtools")
## devtools::install_github("kylepeyton/attentive")
suppressMessages({
  library(tidyverse)
  library(lubridate)
  library(ggforce)
  library(lemon)
  library(rmeta)
  library(coefplot)
  library(ggrepel)
  library(ggthemes)
  library(grid)
  library(attentive)
  library(estimatr)
  library(xtable)
  library(RCurl)
  library(haven)
})

## Helper functions needed to run the replication code below. 
source("helpers.R")

## 1. Replication code for Online Appendix Section A
source("appendix_section_a.R")

## 2. Replication code for Online Appendix Section B
source("appendix_section_b.R")

## 3. Replication code for Manuscript
## Note: this script has been updated to correct the coding errors described 
## at https://doi.org/10.1017/XPS.2022.23
source("manuscript.R")

## Description of datasets included in the replication archive: 

## 1. phc_replications.rds is the dataset for the covid-era replications
## 2. phc_lucid_completes.rds is the data for Fig. 1 in manuscript
## 3. phc_meta_trends.rds is the data for Fig. 4 in manuscript
## 4. manylabs_asian_disease.sav pre-covid replication data for Study 3
## 5. cm_asian_disease.rds pre-covid replication data for Study 3
## 6. hp_welfare.rds pre-covid replication data for Study 4
## 7. gss_welfare.rds pre-covid replication data for Study 4
## 8. druckman_original.csv pre-covid replication data for Study 5
## 9. gilens_original.rds pre-covid replication data for Study 6
## 10. psv_original.rds pre-covid replication data for Study 8
## 11. abp_replication.rds pre-covid replication data for Study 8
## 12. conjoint_original.dta pre-covid replication data for Study 9
## 13. pwk_original.rds pre-covid replication data for Study 10
## 14. tw_original.rds pre-covid replication data for Study 11
## 15. peyton_original.csv pre-covid replication data for Study 12






